#ifndef DYNAMICMAPWINDOW_H
#define DYNAMICMAPWINDOW_H

#include <QObject>
#include <QWidget>
#include <QPaintEvent>
#include "protocolparse.h"
#include "viewobject.h"

class DynamicMap;

class DynamicMapShowWindow : public QWidget
{
    Q_OBJECT
public:
    explicit DynamicMapShowWindow(QString xml_path, QString img_path, QWidget *parent = NULL);
    ~DynamicMapShowWindow();

    void set_show_data(QString file, ProtocolData *python_data, QString xml_path, QString img_path);
    void xml_to_vector(QString fullpath);
    void show_file(ProtocolData* = NULL);
    void create_connect();
    void destroy_all_child();
    void hide_all_child();
    void diff_show_object(DiffShowType dfstype, ProtocolData *python_data);
    void diff_show_suffix(QString suffix);
    void diff_show_itemschange(QMap<QString, change_property> items_change);
    void dymap_show_window_setmask(ViewObjectInfo *info, QMap<QString, change_property> items_change);
    void win32_setmask(QRect sub_rect);
    void destroy_child_by_name(QString);

protected:
    void paintEvent(QPaintEvent *event);

private:
    QVector<ViewObjectInfo*> mViewObjectVector;
    QVector<QString> m_shown_acrossxml_objs;
    QVector<QString> m_new_acrossxml_objs;

    QMap<QString, ViewObjectInfo*> m_shown_objs;
    QVector<QString> m_new_objs;

    QString m_xml_path;
    QString m_img_path;
    QString m_res_path;
    QString m_file_name;
    int m_current_station_pos;
    int m_interval_station_num;
    int m_all_station_num;

    ProtocolData *m_python_data;

    bool m_setmask_flag;
    QRect m_sub_rect;

private:
    void show_by_index(ProtocolData *ptr);
};

#endif // DYNAMICMAPWINDOW_H
